<?php
/*
 * 手机客户端 竞拍统计信息接口
 * 传入参数 
 *           uuid  用户动态主键
 * 返回
 * 			{
 * 				"mAuction": {
 * 					"lead": "领先数",
 * 					"deal": "已得标数",
 * 					"out": "未得标数",
 * 					"paid": "已支付数",
 * 					"unpaid": "未支付数"
 * 				},
 * 				"success": "1成功 0未成功"
 * 			}
 * 2013-11-26
 */
include "inc/public_header.php";

include "func/user.php";				//用户信息处理函数
include "func/userlastbid.php";		//最高出价信息表函数
include "func/userwonpaid.php";		//用户付款信息表函数


//获取用户信息
$uInfoArr = user_getInfoFromUUID();
if(!$uInfoArr){
	echo json_encode(array("success"=>"0","errCode"=>"0","msg"=>"没有获取到用户信息"));
	die;
}
$uid = $uInfoArr["uid"]; //用户信息主键

$reJson = array(); //构建返回值

$auction = array(); //构建展品信息容器
$reJson["mAuction"] = &$auction;

$auction["lead"] 		= userlastbid_getDealAuctionCount($uid);	//用户竞拍中领先的展品数量
$auction["deal"] 		= userlastbid_userBuyerWonCount($uid);		//用户已得标的展品数量
$auction["out"] 		= userlastbid_userBuyerDontWinCount($uid);	//用户未得标的展品数量
$auction["paid"] 		= userwonpaid_userPaidCount($uid);			//用户已支付数
$auction["unpaid"] 		= userlastbid_userUnIntoPaidCount($uid);	//用户未支付的拍品数量
$auction["attention"] 	= user_attentionCount($uid);				//用户未关注数量数量

$reJson["success"] = "1"; //标记操作成功

echo json_encode($reJson);
?>